/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author PARINYA
 */
@Entity
@Table(name = "srv_cureplan")
@NamedQueries({
    @NamedQuery(name = "SrvCureplan.findAll", query = "SELECT s FROM SrvCureplan s"),
    @NamedQuery(name = "SrvCureplan.findById", query = "SELECT s FROM SrvCureplan s WHERE s.id = :id"),
    @NamedQuery(name = "SrvCureplan.findByAgreeDeal", query = "SELECT s FROM SrvCureplan s WHERE s.agreeDeal = :agreeDeal"),
    @NamedQuery(name = "SrvCureplan.findByPriceMinAccept", query = "SELECT s FROM SrvCureplan s WHERE s.priceMinAccept = :priceMinAccept"),
    @NamedQuery(name = "SrvCureplan.findByPriceMaxAccept", query = "SELECT s FROM SrvCureplan s WHERE s.priceMaxAccept = :priceMaxAccept"),
    @NamedQuery(name = "SrvCureplan.findByDateMinAccept", query = "SELECT s FROM SrvCureplan s WHERE s.dateMinAccept = :dateMinAccept"),
    @NamedQuery(name = "SrvCureplan.findByDateMaxAccept", query = "SELECT s FROM SrvCureplan s WHERE s.dateMaxAccept = :dateMaxAccept"),
    @NamedQuery(name = "SrvCureplan.findByAttachHistory", query = "SELECT s FROM SrvCureplan s WHERE s.attachHistory = :attachHistory"),
    @NamedQuery(name = "SrvCureplan.findByRequestQuotation", query = "SELECT s FROM SrvCureplan s WHERE s.requestQuotation = :requestQuotation"),
    @NamedQuery(name = "SrvCureplan.findByStatus", query = "SELECT s FROM SrvCureplan s WHERE s.status = :status")})
public class SrvCureplan implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID")
    private Long id;
    @Column(name = "AgreeDeal")
    private Boolean agreeDeal;
    @Lob
    @Column(name = "Symptom")
    private String symptom;
    @Lob
    @Column(name = "RoomType")
    private String roomType;
    @Column(name = "PriceMin_Accept")
    private BigDecimal priceMinAccept;
    @Column(name = "PriceMax_Accept")
    private BigDecimal priceMaxAccept;
    @Column(name = "DateMin_Accept")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateMinAccept;
    @Column(name = "DateMax_Accept")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateMaxAccept;
    @Lob
    @Column(name = "Allergic_History")
    private String allergicHistory;
    @Lob
    @Column(name = "Disease_History")
    private String diseaseHistory;
    @Column(name = "Attach_History")
    private String attachHistory;
    @Column(name = "Request_Quotation")
    private Boolean requestQuotation;
    @Column(name = "Status")
    private String status;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "srvCureplan")
    private Collection<SrcCureplanDoctor> srcCureplanDoctorCollection;
    @JoinColumn(name = "SRV_CureService_ID", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private SrvCureservice srvCureservice;
    @JoinColumn(name = "M_User_ID", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private MUser mUser;
    @JoinColumn(name = "M_Specialist_ID", referencedColumnName = "ID")
    @ManyToOne
    private MSpecialist mSpecialist;
    @JoinColumn(name = "M_Hotel_ID", referencedColumnName = "ID")
    @ManyToOne
    private MHotel mHotel;

    public SrvCureplan() {
    }

    public SrvCureplan(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Boolean getAgreeDeal() {
        return agreeDeal;
    }

    public void setAgreeDeal(Boolean agreeDeal) {
        this.agreeDeal = agreeDeal;
    }

    public String getSymptom() {
        return symptom;
    }

    public void setSymptom(String symptom) {
        this.symptom = symptom;
    }

    public String getRoomType() {
        return roomType;
    }

    public void setRoomType(String roomType) {
        this.roomType = roomType;
    }

    public BigDecimal getPriceMinAccept() {
        return priceMinAccept;
    }

    public void setPriceMinAccept(BigDecimal priceMinAccept) {
        this.priceMinAccept = priceMinAccept;
    }

    public BigDecimal getPriceMaxAccept() {
        return priceMaxAccept;
    }

    public void setPriceMaxAccept(BigDecimal priceMaxAccept) {
        this.priceMaxAccept = priceMaxAccept;
    }

    public Date getDateMinAccept() {
        return dateMinAccept;
    }

    public void setDateMinAccept(Date dateMinAccept) {
        this.dateMinAccept = dateMinAccept;
    }

    public Date getDateMaxAccept() {
        return dateMaxAccept;
    }

    public void setDateMaxAccept(Date dateMaxAccept) {
        this.dateMaxAccept = dateMaxAccept;
    }

    public String getAllergicHistory() {
        return allergicHistory;
    }

    public void setAllergicHistory(String allergicHistory) {
        this.allergicHistory = allergicHistory;
    }

    public String getDiseaseHistory() {
        return diseaseHistory;
    }

    public void setDiseaseHistory(String diseaseHistory) {
        this.diseaseHistory = diseaseHistory;
    }

    public String getAttachHistory() {
        return attachHistory;
    }

    public void setAttachHistory(String attachHistory) {
        this.attachHistory = attachHistory;
    }

    public Boolean getRequestQuotation() {
        return requestQuotation;
    }

    public void setRequestQuotation(Boolean requestQuotation) {
        this.requestQuotation = requestQuotation;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Collection<SrcCureplanDoctor> getSrcCureplanDoctorCollection() {
        return srcCureplanDoctorCollection;
    }

    public void setSrcCureplanDoctorCollection(Collection<SrcCureplanDoctor> srcCureplanDoctorCollection) {
        this.srcCureplanDoctorCollection = srcCureplanDoctorCollection;
    }

    public SrvCureservice getSrvCureservice() {
        return srvCureservice;
    }

    public void setSrvCureservice(SrvCureservice srvCureservice) {
        this.srvCureservice = srvCureservice;
    }

    public MUser getMUser() {
        return mUser;
    }

    public void setMUser(MUser mUser) {
        this.mUser = mUser;
    }

    public MSpecialist getMSpecialist() {
        return mSpecialist;
    }

    public void setMSpecialist(MSpecialist mSpecialist) {
        this.mSpecialist = mSpecialist;
    }

    public MHotel getMHotel() {
        return mHotel;
    }

    public void setMHotel(MHotel mHotel) {
        this.mHotel = mHotel;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SrvCureplan)) {
            return false;
        }
        SrvCureplan other = (SrvCureplan) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.SrvCureplan[id=" + id + "]";
    }

}
